/* 现代化页面增强样式 */

/* 整体页面样式优化 */
.container {
    max-width: 1400px;
    padding: 20px;
}

/* 卡片悬停效果 */
.stat-card, .input-section, .chart-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.25);
}

/* 统计面板折叠增强效果 */
.stats-panel {
    transition: all 0.3s ease;
}

.stats-panel .collapse-toggle {
    position: relative;
    overflow: hidden;
}

.stats-panel .collapse-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.stats-panel .collapse-toggle:hover::before {
    left: 100%;
}

/* 折叠状态下的统计面板优化 */
.stats-panel:has(#statsCollapse:not(.show)) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-color: rgba(102, 126, 234, 0.2);
}

/* 图表容器在折叠时的动画 */
.chart-container {
    position: relative;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#statsCollapse:not(.show) .chart-container {
    opacity: 0;
    transform: scale(0.95);
}

/* 统计卡片在折叠时的动画 */
.stat-card {
    transition: all 0.3s ease, opacity 0.2s ease;
}

#statsCollapse:not(.show) .stat-card {
    opacity: 0;
    transform: translateY(-10px);
}

/* 按钮组在折叠时的动画 */
.btn-group {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#statsCollapse:not(.show) .btn-group {
    opacity: 0;
    transform: translateY(-5px);
}

/* 按钮增强效果 */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    font-weight: 500;
    border-radius: 8px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 表格行动画效果 */
.table tbody tr {
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.table tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    border-left-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

/* 股票类型特殊样式增强 */
.stock-type-1 {
    background: linear-gradient(90deg, rgba(255, 152, 0, 0.1), rgba(255, 193, 7, 0.05)) !important;
    border-left: 4px solid #ff9800 !important;
    position: relative;
}



.stock-type-2 {
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.1), rgba(129, 199, 132, 0.05)) !important;
    border-left: 4px solid #4caf50 !important;
    animation: newStockGlow 3s ease-in-out infinite;
}

.stock-type-3 {
    background: linear-gradient(90deg, rgba(33, 150, 243, 0.1), rgba(100, 181, 246, 0.05)) !important;
    border-left: 4px solid #2196f3 !important;
}

.stock-type-4 {
    background: linear-gradient(90deg, rgba(233, 30, 99, 0.1), rgba(240, 98, 146, 0.05)) !important;
    border-left: 4px solid #e91e63 !important;
}

/* 动画效果 */
@keyframes twinkle {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.5; transform: translateY(-50%) scale(1.2); }
}

@keyframes newStockGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(76, 175, 80, 0.3); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.6); }
}

/* 概念标签样式增强 */
.gainian-clickable {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white !important;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none !important;
    display: inline-block;
    margin: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* 概念标签样式增强 */
.nohotgainian-clickable {
    background: linear-gradient(135deg, #04414d, #32d96b);
    color: white !important;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none !important;
    display: inline-block;
    margin: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.gainian-clickable:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #5a6fd8, #6a5acd);
}

/* 加载指示器增强 */
.loading-indicator.active {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.loading-spinner {
    background: conic-gradient(from 0deg, transparent, white, transparent);
    border: none !important;
    mask: radial-gradient(circle at center, transparent 6px, black 7px);
}

/* 排序图标增强 */
.sortable {
    position: relative;
}

.sortable:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.sort-icon {
    transition: all 0.3s ease;
}

.sortable:hover .sort-icon {
    transform: scale(1.2);
    color: #667eea !important;
}

/* 复制按钮增强 */
.copy-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 4px 8px;
    font-size: 10px;
    transition: all 0.3s ease;
    opacity: 0;
    transform: scale(0.8);
}

.focus-stock .copy-btn,
tr:hover .copy-btn {
    opacity: 1;
    transform: scale(1);
}

.copy-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 统计数字动画 */
.stat-number {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: numberPulse 2s ease-in-out infinite;
}

@keyframes numberPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 输入框焦点效果 */
.form-control:focus, .form-select:focus {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

/* 开关按钮增强 */
.form-check-input {
    transition: all 0.3s ease;
}

.form-check-input:checked {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* 警告框增强 */
.alert {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-left: 4px solid #667eea;
}

/* 徽章增强 */
.badge {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 响应式增强 */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 15px;
    }
    
    .chart-container {
        height: 250px;
        margin-bottom: 20px;
    }
    
    .header-buttons {
        justify-content: center;
        margin-top: 15px;
    }
    
    .btn-group {
        flex-direction: column;
        gap: 10px;
    }
}

/* 表格头部固定增强 */
.table thead th {
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 成功消息样式 */
.copy-success-icon {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: successBounce 0.6s ease-out;
}

@keyframes successBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 全局动画性能优化 */
* {
    will-change: auto;
}

.stat-card, .btn, .table tbody tr {
    will-change: transform;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .main-container {
        background: rgba(30, 30, 30, 0.95);
        color: #e0e0e0;
    }
    
    .stats-panel, .input-controls-section, .table-responsive {
        background: rgba(40, 40, 40, 0.9);
        color: #e0e0e0;
    }
    
    .table th {
        background: linear-gradient(135deg, #424242, #616161);
    }
    
    .form-control, .form-select {
        background: rgba(50, 50, 50, 0.8);
        color: #e0e0e0;
        border-color: rgba(102, 126, 234, 0.3);
    }
}

/* 标题区域样式优化 */
h2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 按钮组样式优化 */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* 输入区域样式优化 */
.input-section {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group-text {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #495057;
    font-weight: 500;
    min-width: 100px;
    justify-content: center;
}

.form-control {
    border-color: #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.15);
}

/* 表格样式优化 */
.table {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 15px;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 2px solid #dee2e6;
    padding: 12px;
    font-weight: 600;
    color: white;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    font-size: 15px;
}

/* 限制所属热门板块列的宽度 */
.table th:nth-child(8),
.table td:nth-child(8) {
    max-width: 200px;
    width: 200px;
    word-wrap: break-word;
    word-break: break-all;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 板块名称在单元格内的样式优化 */
.table td:nth-child(8) .gainian-clickable {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 1px 2px;
}

/* 状态指示器样式优化 */
.alert {
    border-radius: 8px;
    margin-bottom: 20px;
}

.badge {
    padding: 6px 10px;
    border-radius: 6px;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h2 {
        font-size: 1.5rem;
        padding: 10px;
    }
    
    .btn-group {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table thead th {
        font-size: 13px;
        padding: 10px 8px;
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .table tbody td {
        font-size: 14px;
        padding: 8px 6px;
    }
}

/* 加载动画优化 */
.loading-spinner {
    width: 20px;
    height: 20px;
    border-width: 3px;
}

/* 历史记录下拉框优化 */
.history-dropdown {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.history-item {
    padding: 10px 15px;
    transition: background-color 0.2s ease;
}

/* 开关按钮样式优化 */
.form-check-input {
    width: 45px;
    height: 24px;
    margin-top: 0;
}

.form-check-label {
    margin-left: 10px;
    line-height: 24px;
}

/* 图表容器增强 */
.chart-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    transform: rotate(45deg);
    animation: chartShimmer 3s linear infinite;
    pointer-events: none;
}

@keyframes chartShimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* 折叠动画增强 */
.collapse {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.collapse-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 全屏功能增强样式 */
.table-responsive.fullscreen {
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.98) !important;
}

.fullscreen-exit-btn {
    backdrop-filter: blur(10px);
    background: rgba(220, 53, 69, 0.9) !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.fullscreen-exit-btn:hover {
    background: rgba(220, 53, 69, 1) !important;
    border-color: rgba(255, 255, 255, 0.5);
}

/* 全屏按钮增强效果 */
#fullscreenBtn {
    position: relative;
    overflow: hidden;
}

#fullscreenBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

#fullscreenBtn:hover::before {
    left: 100%;
}

/* 全屏模式下的表格增强 */
.table-responsive.fullscreen .table tbody tr:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    transform: scale(1.005);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.table-responsive.fullscreen .gainian-clickable {
    padding: 6px 10px;
    font-size: 12px;
    margin: 3px;
}

.table-responsive.fullscreen .gainian-clickable:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 6px 15px rgba(102, 126, 234, 0.4);
}

/* 全屏模式下的复制按钮增强 */
.table-responsive.fullscreen .copy-btn {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 18px;
}

.table-responsive.fullscreen tr:hover .copy-btn {
    opacity: 1;
    transform: scale(1.05);
}

/* 全屏进入/退出动画增强 */
@keyframes fullscreenEnterEnhanced {
    0% {
        opacity: 0;
        transform: scale(0.9) rotateX(10deg);
        filter: blur(5px);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95) rotateX(5deg);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
        filter: blur(0px);
    }
}

@keyframes fullscreenExitEnhanced {
    0% {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
        filter: blur(0px);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95) rotateX(-5deg);
        filter: blur(2px);
    }
    100% {
        opacity: 0;
        transform: scale(0.9) rotateX(-10deg);
        filter: blur(5px);
    }
}

.table-responsive.fullscreen {
    animation: fullscreenEnterEnhanced 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.table-responsive.fullscreen-exit {
    animation: fullscreenExitEnhanced 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 全屏模式下的排序图标增强 */
.table-responsive.fullscreen .sortable:hover .sort-icon {
    transform: scale(1.3) rotate(5deg);
    color: #667eea !important;
}

/* 全屏模式下的状态指示器 */
.table-responsive.fullscreen::after {
    content: '全屏模式 - 按ESC键退出';
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10001;
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 控制面板折叠按钮增强 */
.input-controls-section .collapse-toggle {
    position: relative;
    overflow: hidden;
}

.input-controls-section .collapse-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.input-controls-section .collapse-toggle:hover::before {
    left: 100%;
}

/* 全屏模式下的表格字体优化 */
.table-responsive.fullscreen .table {
    font-size: 16px;
}

.table-responsive.fullscreen .table thead th {
    font-size: 15px;
    padding: 15px 12px;
}

.table-responsive.fullscreen .table tbody td {
    font-size: 16px;
    padding: 12px 10px;
}

/* 表格容器滚动优化 - 已禁用独立滚动条 */
.table-responsive {
    position: relative;
}

/* 确保表头在所有浏览器中都能固定 */
.table thead {
    position: sticky;
    top: 0;
    z-index: 100;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    position: sticky;
    top: 0;
    z-index: 100;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(10px);
}

/* 全屏模式下的表头固定增强 */
.table-responsive.fullscreen thead th {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(15px);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
} 